package com.example.smart_hospital.service.user.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.smart_hospital.mapper.UserMapper;
import com.example.smart_hospital.pojo.User;
import com.example.smart_hospital.service.user.UserService;
import org.apache.ibatis.session.ResultHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public int insert(User entity) {
        return userMapper.insert(entity);
    }

    @Override
    public int deleteById(Serializable id) {
        return userMapper.deleteById(id);
    }

    @Override
    public int deleteById(User entity) {
        return userMapper.deleteById(entity);
    }

    @Override
    public int delete(Wrapper<User> queryWrapper) {
        return userMapper.delete(queryWrapper);
    }

    @Override
    public int deleteBatchIds(Collection<?> idList) {
        return userMapper.deleteBatchIds(idList);
    }

    @Override
    public int updateById(User entity) {
        return updateById(entity);
    }

    @Override
    public int update(User entity, Wrapper<User> updateWrapper) {
        return userMapper.update(entity,updateWrapper);
    }

    @Override
    public User selectById(Serializable id) {
        return userMapper.selectById(id);
    }

    @Override
    public List<User> selectBatchIds(Collection<? extends Serializable> idList) {
        return selectBatchIds(idList);
    }

    @Override
    public void selectBatchIds(Collection<? extends Serializable> idList, ResultHandler<User> resultHandler) {

    }

    @Override
    public Long selectCount(Wrapper<User> queryWrapper) {
        return userMapper.selectCount(queryWrapper);
    }

    @Override
    public List<User> selectList(Wrapper<User> queryWrapper) {
        return userMapper.selectList(queryWrapper);
    }

    @Override
    public void selectList(Wrapper<User> queryWrapper, ResultHandler<User> resultHandler) {
        userMapper.selectList(queryWrapper,resultHandler);
    }

    @Override
    public List<User> selectList(IPage<User> page, Wrapper<User> queryWrapper) {
        return userMapper.selectList(page,queryWrapper);
    }

    @Override
    public void selectList(IPage<User> page, Wrapper<User> queryWrapper, ResultHandler<User> resultHandler) {
        userMapper.selectList(page,queryWrapper,resultHandler);
    }

    @Override
    public List<Map<String, Object>> selectMaps(Wrapper<User> queryWrapper) {
        return userMapper.selectMaps(queryWrapper);
    }

    @Override
    public void selectMaps(Wrapper<User> queryWrapper, ResultHandler<Map<String, Object>> resultHandler) {
        userMapper.selectMaps(queryWrapper,resultHandler);
    }

    @Override
    public List<Map<String, Object>> selectMaps(IPage<? extends Map<String, Object>> page, Wrapper<User> queryWrapper) {
        return userMapper.selectMaps(page,queryWrapper);
    }

    @Override
    public void selectMaps(IPage<? extends Map<String, Object>> page, Wrapper<User> queryWrapper, ResultHandler<Map<String, Object>> resultHandler) {
            userMapper.selectMaps(page,queryWrapper,resultHandler);
    }

    @Override
    public <E> List<E> selectObjs(Wrapper<User> queryWrapper) {
        return userMapper.selectObjs(queryWrapper);
    }

    @Override
    public <E> void selectObjs(Wrapper<User> queryWrapper, ResultHandler<E> resultHandler) {
        userMapper.selectObjs(queryWrapper,resultHandler);
    }
}
